<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no,
    initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="${ctx}/static/h5/css/public/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="${ctx}/static/h5/css/personal/index.css" type="text/css">
    <title>个人资料</title>
</head>
<body id="ancestor">
<header>
    <h4>我的</h4>
</header>
<!--我的-->
<section class="tab-content">
    <div id="myself" class="tab-pane fade in active">
        <div class="posonnal-info">
            <a href="" class="personDetail">
                <c:if test="${empty person}">
                    <img src="${ctx}/static/h5/images/family_icon.png" class="head" alt=""/>
                </c:if>
                <c:if test="${!empty person}">
                    <c:if test="${empty person.avatar}">
                        <img src="${ctx}/static/h5/images/head-personnal.png" class="head" alt=""/>
                    </c:if>
                    <c:if test="${!empty person.avatar}">
                        <img src="${person.avatar}" class="head" alt=""/>
                    </c:if>
                </c:if>
                <span>${person.name}</span>
                <img src="${ctx}/static/h5/images/erweima.png" class="erweima" alt=""/>
            </a>
        </div>
        <ul>
            <li>
                <a href="#" class="personone">
                    <img src="${ctx}/static/h5/images/my_page.png" alt=""/>
                    <span>个人页面</span>
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" class="tiaozhuan" alt=""/>
                </a>
            </li>
            <li>
                <a href="#" class="jifen">
                    <img src="${ctx}/static/h5/images/my_jifen.png" alt=""/>
                    <span>积分</span>
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" class="tiaozhuan" alt=""/>
                </a>
            </li>
            <li>
                <a href="/h5/user/sugestion">
                    <img src="${ctx}/static/h5/images/suggest.png" alt=""/>
                    <span>意见反馈</span>
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" class="tiaozhuan" alt=""/>
                </a>
            </li>
        <%--    <li>
                <a href="/h5/user/settings">
                    <img src="${ctx}/static/h5/images/settings.png" alt=""/>
                    <span>设置</span>
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" class="tiaozhuan" alt=""/>
                </a>
            </li>--%>
            <li>
                <a href="/h5/user/devote" class="devote">
                    <img src="${ctx}/static/h5/images/devote.png" alt=""/>
                    <span>捐赠</span>
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" class="tiaozhuan" alt=""/>
                </a>
            </li>
            <li>
                <a href="#" class="logout">
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" alt=""/>
                    <span>退出登录</span>
                    <img src="${ctx}/static/h5/images/tiaozhuan.png" class="tiaozhuan" alt=""/>
                </a>
            </li>
        </ul>
    </div>
</section>
<footer class="footer">
    <ul class="nav nav-pills">
        <li>
            <a href="/h5/index/home" class="mesager">消息</a>
        </li>
        <li>
            <a href="/h5/family/" class="family">家族</a>
        </li>
        <li>
            <a href="/h5/find/" class="find">发现</a>
        </li>
        <li class="active">
            <a href="/h5/user/mzone" class="myself">我的</a>
        </li>
    </ul>
</footer>
</body>
<script src="${ctx}/static/h5/js/public/jquery-2.2.3.min.js"></script>
<script src="${ctx}/static/h5/js/public/bootstrap.min.js"></script>
<script src="${ctx}/static/h5/js/personal/index.js"></script>
<script src="${ctx}/static/h5/js/personal/myself.js"></script>
<script>
    $(function () {
        var userId=localStorage.getItem("userId");
        var personId=localStorage.getItem("personId");

        //个人页面
        $(".personone").on("click",function(){
            var url="/h5/user/personal?id="+userId+"&url=1";
            window.location.href=url;
        })
        //积分
        $(".jifen").on("click",function () {
            var url="/h5/user/jifen?userId="+userId;
            window.location.href=url;
        })
        $(".mesager").on("click",function () {
            var url="";
            if(userId == "" || userId == null){
                url="/h5/user/login";
            }else {
                url="/h5/index/home?userId="+userId
            }
            $(this).attr("href",url);
        })
        $(".family").on("click",function () {
            var url="";
            if(userId == "" || userId == null){
                url="/h5/user/login";
            }else {
                url="/h5/family/family?userId="+userId
            }
            $(this).attr("href",url);
        })

        //捐赠
        $(".devote").on("click",function () {
            var url="/h5/user/devote?userId="+userId;
            $(this).attr("href",url);
        })

        $(".personDetail").on("click",function () {
            var url="/h5/user/personformation?id="+personId
            $(this).attr("href",url);
        })
        $(".myself").on("click",function () {
            var url="";
            if(userId == "" || userId == null){
                url="/h5/user/login";
            }else {
                url="/h5/user/mzone?userId="+userId
            }
            $(this).attr("href",url);
        })
    })
</script>
</html>